package com.zcf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zcf.common.json.Body;
import com.zcf.pojo.ClubUser;
import com.zcf.pojo.Game_club;
import com.zcf.pojo.Gametea;
import com.zcf.pojo.Integral;
import com.zcf.service.Game_clubServiceImpl;
import com.zcf.vo.out.LayuiJson;

@CrossOrigin
@Controller
@ResponseBody
@RequestMapping("/club")
public class Game_clubControllrt {
	@Autowired
	Game_clubServiceImpl clubServiceImpl;
	
	/**
	 * 创建俱乐部
	 * @param user
	 * @return
	 */
	@PostMapping("createclub")
	public Body createclub(Game_club club,@RequestParam(value = "userid") long userid){
		return clubServiceImpl.createclub(club,userid);
	}
	/**
	 * 外围获取俱乐部
	 * @param user
	 * @return
	 */
	@PostMapping("getclub")
	public Body getclub(Game_club club){
		return clubServiceImpl.getclub(club);
	}
	/**
	 * 添加俱乐部房间
	 * @param gametea
	 * @param roomName
	 * @return
	 */
	@PostMapping("addroom")
	public Body addroom(Gametea gametea,@RequestParam(value = "clubid")String clubid){
		return clubServiceImpl.addroom(gametea,clubid);
	}
	/**
	 * 添加扎金花房间
	 * @param gametea
	 * @param clubid
	 * @return
	 */
	@PostMapping("addZroom")
	public Body addZroom(Gametea gametea,@RequestParam(value = "clubid")String clubid){
		return clubServiceImpl.addZroom(gametea,clubid);
	}
	
	/**
	 * 解散俱乐部房间
	 * @param gametea
	 * @return
	 */
	@PostMapping("delroom")
	public Body delroom(Game_club club,String tablename){
		return clubServiceImpl.delroom(club,tablename);
	}
	
	/**
	 * 后台获取俱乐部
	 * @return
	 */
	@PostMapping("getclubs")
	public LayuiJson getclubs(Game_club club,@RequestParam(value = "pageNum") int pageNum,
            @RequestParam(value = "pageSize") int pageSize){
		return clubServiceImpl.getclubs(club,pageNum,pageSize);
	}
	
	/**
	 * 后台解散俱乐部
	 * @return
	 */
	@PostMapping("delclub")
	public Body delclub(Game_club club){
		return clubServiceImpl.delclub(club);
	}
	
	/**
	 * 加入俱乐部
	 * @param clubUser
	 * @return
	 */
	@PostMapping("joinclub")
	public Body joinclub(ClubUser clubUser){
		return clubServiceImpl.joinclub(clubUser);
	}
	
	/**
	 * 获取俱乐部房间
	 * @param roomName
	 * @return
	 */
	@PostMapping("getclubroom")
	public Body getclubroom(@RequestParam(value = "clubid")String clubid,@RequestParam(value = "userid")int userid){
		return clubServiceImpl.getclubroom(clubid,userid);
	}
	/**
	 * 获取俱乐部用户
	 * @param clubUser
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@PostMapping("getclubuser")
	public LayuiJson getclubuser(ClubUser clubUser,@RequestParam(value = "pageNum") int pageNum,
            @RequestParam(value = "pageSize") int pageSize){
		return clubServiceImpl.getclubuser(clubUser,pageNum,pageSize);
	}
	/**
	 * 获取俱乐部成员
	 * @param clubUser
	 * @return
	 */
	@PostMapping("getclubusers")
	public Body getclubusers(ClubUser clubUser,@RequestParam(value = "type") int type,@RequestParam(value = "uid") int uid){
		return clubServiceImpl.getclubusers(clubUser,type,uid);
	}
	
	/**
	 * 前端增加俱乐部用户积分
	 * @param clubUser
	 * @return
	 */
	@PostMapping("uppoints")
	public Body uppoints(ClubUser clubUser,@RequestParam("adjustid") int adjustid ){
		return clubServiceImpl.uppoints(clubUser,adjustid);
	}
	
	/**
	 * 俱乐部申请列表
	 * @param clubUser
	 * @return
	 */
	@PostMapping("applyuser")
	public Body applyuser(ClubUser clubUser){
		return clubServiceImpl.applyuser(clubUser);
	}
	/**
	 * 同意申请
	 * @param clubUser
	 * @return
	 */
	@PostMapping("agreeapply")
	public Body agreeapply(ClubUser clubUser){
		return clubServiceImpl.agreeapply(clubUser);
	}
	/**
	 * 拒绝申请
	 * @param clubUser
	 * @return
	 */
	@PostMapping("refused")
	public Body refused(ClubUser clubUser){
		return clubServiceImpl.refused(clubUser);
	}
	
	
	/**
	 * 修改俱乐部积分
	 * @param club
	 * @return
	 */
	@PostMapping("editRoomcard")
	public Body editRoomcard(Game_club club){
		return clubServiceImpl.editRoomcard(club);
	}
	/**
	 * 剔除俱乐部用户
	 * @param clubUser
	 * @return
	 */
	@PostMapping("Tuser")
	public Body Tuser(ClubUser clubUser){
		return clubServiceImpl.Tuser(clubUser);
	}
	/**
	 * 获取我的俱乐部
	 * @param clubUser
	 * @return
	 */
	@PostMapping("getmyclub")
	public Body getmyclub(ClubUser clubUser){
		return clubServiceImpl.getmyclub(clubUser);
	}
	/**
	 * 获取俱乐部成员贡献积分
	 * @param clubUser
	 * @return
	 */
	@PostMapping("contribution")
	public Body contribution(ClubUser clubUser){
		return clubServiceImpl.contribution(clubUser);
	}
	/**
	 * 获取俱乐部增减积分
	 * @param integral
	 * @return
	 */
	@PostMapping("getIntegral")
	public Body getIntegral(Integral integral){
		return clubServiceImpl.getIntegral(integral);
	}
	
	/**
	 * 规则
	 * @param roomName
	 * @return
	 */
	@PostMapping("getrules")
	public Body getrules(@RequestParam(value ="roomName") String roomName){
		return clubServiceImpl.getrules(roomName);
	}
	/**
	 * 扎金花规则
	 * @param roomName
	 * @return
	 */
	@PostMapping("getZrules")
	public Body getZrules(@RequestParam(value ="roomName") String roomName){
		return clubServiceImpl.getZrules(roomName);
	}
	/**
	 * 存储金币
	 * @param clubUser
	 * @return
	 */
	@PostMapping("storage")
	public Body storage(ClubUser clubUser){
		return clubServiceImpl.storage(clubUser);
	}
	/**
	 * 取出金币
	 * @param clubUser
	 * @return
	 */
	@PostMapping("takeoutmoney")
	public Body takeoutmoney(ClubUser clubUser){
		return clubServiceImpl.takeoutmoney(clubUser);
	}
	/**
	 * 点击金币存储
	 * @param clubUser
	 * @return
	 */
	@PostMapping("clickmoney")
	public Body clickmoney(ClubUser clubUser){
		return clubServiceImpl.clickmoney(clubUser);
	}
	/**
	 * 冻结、任命合伙人
	 * @param clubUser
	 * @return
	 */
	@PostMapping("operationclubuser")
	public Body operationclubuser(ClubUser clubUser){
		return clubServiceImpl.operationclubuser(clubUser);
	}
	/**
	 * 获取俱乐部合伙人
	 * @param clubUser
	 * @return
	 */
	@PostMapping("getpartner")
	@ResponseBody
	public Body getpartner(ClubUser clubUser){
		return clubServiceImpl.getpartner(clubUser);
	}
	/**
	 * 设置合作比例
	 * @param clubUser
	 * @return
	 */
	@PostMapping("setcooperation")
	
	public Body setcooperation(ClubUser clubUser){
		return clubServiceImpl.setcooperation(clubUser);
	}
	/**
	 * 合伙人获取成员
	 * @param clubUser
	 * @return
	 */
	@PostMapping("hgetuser")
	public Body hgetuser(ClubUser clubUser ,@RequestParam(value = "type") int type){
		return clubServiceImpl.hgetuser(clubUser,type);
	}
	/**
	 * 编辑公告
	 * @param club
	 * @return
	 */
	@PostMapping("editcontent")
	public Body editcontent(Game_club club){
		return clubServiceImpl.editcontent(club);
	}
	/**
	 * 获取公告
	 * @param club
	 * @return
	 */
	@PostMapping("getcontent")
	public Body getcontent(Game_club club){
		return clubServiceImpl.getcontent(club);
	}
	/**
	 * 金币统计
	 * @param clubUser
	 * @return
	 */
	@PostMapping("moneystatistical")
	public Body moneystatistical(ClubUser clubUser){
		return clubServiceImpl.moneystatistical(clubUser);
	}
	
}
